function formSubmit(formId){
	document.getElementById(formId).submit();
}

function goToPage(num, formId){
	$("#pageNo").attr("value",num);
	formSubmit(formId);
}

function redirect(url){
	location.href = url;
}

function goSort(currentField, currentOrder, thisField){
	if(currentField==thisField){
		if("desc"==currentOrder){
			$("#sortOrder").val("asc");
		}else{
			$("#sortOrder").val("desc");
		}
	}else{
		$("#sortOrder").val("desc");
	}
	$("#sortField").val(thisField);
	$("#hiddenFrm").submit();
}

function checkAll(checkBoxName){
	var a = document.getElementsByName(checkBoxName);    
    var n = a.length;    
    for (var i=0; i<n; i++){
    	a[i].checked = true;
    }
}

function uncheckAll(checkBoxName){
	var a = document.getElementsByName(checkBoxName);    
    var n = a.length;    
    for (var i=0; i<n; i++){
    	a[i].checked = false;
    }
}

function joinCheckedValue(checkBoxName, valueNodeId, valueDisplayId){
	var a = document.getElementsByName(checkBoxName);    
    var n = a.length;  
    var value='';
    var display='';
    for (var i=0; i<n; i++){
    	if(a[i].checked){
    		if(value==''){
    			value = a[i].value;
    			display = a[i].title + "...";
    		}else{
    			value = value + ',' + a[i].value;
    		}
    	}
    }
    $("#"+valueNodeId).val(value);
    if(display!=''){
    	$("#"+valueDisplayId).html(display);
    }
}

